<%@ page language="java" import="java.util.*" pageEncoding="utf-8"
	isELIgnored="false"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
    String path = request.getContextPath();
			String basePath = request.getScheme() + "://"
					+ request.getServerName() + ":" + request.getServerPort()
					+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>

<script type="text/javascript" src="<%=request.getContextPath()%>/easyui/jquery.min.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/easyui/locale/easyui-lang-zh_CN.js"></script>
<link href="<%=request.getContextPath()%>/easyui/themes/default/easyui.css" rel="stylesheet" type="text/css" />
<link href="<%=request.getContextPath()%>/easyui/themes/icon.css" rel="stylesheet" type="text/css" />
<link href="<%=request.getContextPath()%>/css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery-2.1.4.min.js"></script>
<link rel="stylesheet" href="<%=request.getContextPath()%>/css/jPages.css">
<link rel="stylesheet" href="<%=request.getContextPath()%>/css/animate.css">
<script src="<%=request.getContextPath()%>/js/jquery-1.8.2.min.js"></script>
<script src="<%=request.getContextPath()%>/js/jPages.js"></script>
<style >
  /*   .toolbar1 table{
    width: 552px;
    } */
    input{
       border: solid 1px #d7a372;
    }
</style>
<script type="text/javascript">
$(function(){  
	$("div.holder").jPages({  
	  containerID : "item", 
	  first:"首页", 
	  previous : "上一页",  
	  next : "下一页",
	  last:"尾页",  
	  perPage : 10,  
	  //delay : 100,
	  //动画效果
	  //animation:"bounceInLeft"
	});  
 });  
</script>
<script type="text/javascript">
$(document).ready(function(){
  $(".click").click(function(){
 	 $(".tip").fadeIn(200);
  });
  
  $(".sure").click(function(){
 	 $(".tip").fadeOut(100);
  });

  $(".cancel").click(function(){
	  $(".tip").fadeOut(100);
	  $(".jiefeng").fadeOut(100);
  });
  
  $("input.button").click(function(){
		var username = "";
		var mobile = "";
		var content = $("input[name=find]").val();
		var text = $(".selector").find("option:selected").text();
		if(text == "昵称"){
			username = content; 
		}else if(text == "手机号"){
			mobile = content;
		}
		if(content == "" || text == "请选择分类"){
			alert("请输入搜索信息！");
			return;
		}
		window.location.href="/htx-backer/selectRecommendList?username="+username+"&mobile="+mobile;
	})
});
</script>
</head>

<body>
	<div class="place">
		<span>位置：</span>
		<ul class="placeul">
			<li><ema href="javascript:void">首页</em></li>
			<li><ema href="javascript:void">用户管理</em></li>
			<li><ema href="javascript:void">推荐用户列表</em></li>
		</ul>
	</div>
	<div class="rightinfo">
		<div >
			<table>
				<form action="<%=request.getContextPath()%>/selectRecommendList" method="post">
					<tr>
						<td class="zi"><span>注册时间：</span></td>
						<td><input type="date" name="startTime" />至<input type="date" name="endTime" /></td>
						<td class="zi" ><span >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;昵称：</span></td>
						<td><input type="text" name="username" /></td>
						<td class="zi" ><span >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;手机号：</span></td>
						<td><input type="text" name="mobile" /></td>
						<td><input type="hidden" name="test" value="test"/></td>
						<td><input type="submit" value="查询" style="background-color: #dca571; padding: 7px; border-radius: 5%;margin-left:2px;height: 35px;" class="button" /></td>
					</tr>
				</form>
			</table>
		</div>
		<div class="tools">
			<ul class="toolbar">
				<li class="exportExcel"><span><img src="<%=request.getContextPath()%>/images/t04.png" /></span>导出</li>
			</ul>
		</div>
		<table class="tablelist">
			<thead>
				<tr>
					<th>头像</th>
					<th>昵称</th>
					<th>手机号</th>
					<th>性别</th>
					<th>地址</th>
					<th>用户等级</th>
					<th>实名认证</th>
					<th>企业认证</th>
					<th>会员</th>
					<th>我的推荐人</th>
					<th>最近登录时间</th>
					<th>操作</th>
				</tr>
			</thead>
			<tbody class="tb" id="item">
				<c:forEach items="${lists}" var="data">
					<tr>
						<td><img src="${data.photo}" height="60px" width="60px"/></td>
						<td>${data.username}</td>
						<td>${data.mobile}</td>
						<td>
							<c:if test="${data.gender == 0}">未知</c:if>
							<c:if test="${data.gender == 1}">男</c:if>
							<c:if test="${data.gender == 2}">女</c:if>
						</td>
						<td>${data.address}</td>
						<td>${data.integral_rank}</td>
						<td>
							<c:if test="${data.identity_audit == 1}">已认证</c:if>
							<c:if test="${data.identity_audit == 0}">未认证</c:if>
						</td>
						<td>
							<c:if test="${data.enterprise_audit == 1}">已认证</c:if>
							<c:if test="${data.enterprise_audit == 0}">未认证</c:if>
						</td>
						<td>
							<c:if test="${data.vip == 1}">VIP</c:if>
							<c:if test="${data.vip == 0}">普通用户</c:if>
						</td>
						<td>${data.recommend_nums}人</td>
						<td>${data.login_time}</td>
						<c:if test="${data.is_ban == 1}">
						    <td>
								<a href="/htx-backer/selectUserList?userid=${data.id}" style="cursor:pointer;color:blue;font-size:14px;font-weight:bold;">查看</a>
							&nbsp;&nbsp;&nbsp;
							<strong onclick="update(this)" style="cursor:pointer;color:blue;font-size:14px">封号</strong>
							</td>
						</c:if>
						<c:if test="${data.is_ban == 0}">
							<td>
							<a href="/htx-backer/selectUserList?userid=${data.id}" style="cursor:pointer;color:blue;font-size:14px;font-weight:bold;">查看</a>
                            &nbsp;&nbsp;&nbsp;
                            <strong onclick="update(this)" style="cursor:pointer;color:blue;font-size:14px">解封</strong>
	                        </td>
						</c:if>
						<input type="hidden" value="${data.id}"/>
					</tr>
				</c:forEach>
			</tbody>
		</table>
		<div style="clear:both;"></div>
		<!-- 分页的页码 -->
		<div class="holder"></div>
		共${nums}条记录
		<div class="tip">
			<div class="tiptop">
				<span>提示信息</span>
			</div>
			<div class="tipinfo">
				<span><img src="<%=request.getContextPath()%>/images/ticon.png" /></span>
				<div class="tipright">
					<p>是否确认封号 ？</p>
					<cite>如果是请点击确定按钮 ，否则请点取消。</cite>
				</div>
			</div>
			<div class="tipbtn">
				<input name="" type="button" class="sure" value="确定"/>&nbsp;<input name="" type="button" class="cancel" value="取消" />
			</div>
		</div>
		
		<div class="jiefeng" style="width:485px; height:260px; position:absolute;top:10%; left:30%;background:#fcfdfd;box-shadow:1px 8px 10px 1px #9b9b9b;border-radius:1px;behavior:url(js/pie.htc); display:none; z-index:111111;">
			<div class="tiptop">
				<span>提示信息</span>
			</div>
			<div class="tipinfo">
				<span><img src="<%=request.getContextPath()%>/images/ticon.png" /></span>
				<div class="tipright">
					<p>是否确认解封 ？</p>
					<cite>如果是请点击确定按钮 ，否则请点取消。</cite>
				</div>
			</div>
			<div class="tipbtn">
				<input name="" type="button" class="sure" value="确定"/>&nbsp;<input name="" type="button" class="cancel" value="取消" />
			</div>
		</div>
	</div>
	<script type="text/javascript">
		$('.tablelist tbody tr:odd').addClass('odd');

		  function update(a){
			  var text = $(a).text();
			  var statu = "";
			  if(text == "封号"){
				  $(".tip").fadeIn(500);
				  statu = "0";
			  }else if(text == "解封"){
				  $(".jiefeng").fadeIn(500);
				  statu = "1";
			  }
			  $(".sure").click(function(){
		      	 var params = $(a).parent().parent().find("input[type=hidden]").val() + "," + statu;
		      	 window.location.href="/htx-backer/updateUserStatu?params="+params;
		     });
		  }
		  
		  $(".exportExcel").click(function(){
				 window.location.href = "/htx-backer/exportExcels?phone="+${phone};
		  })
	</script>
	
</body>
</html>
